<?php

namespace App\Livewire;

use App\Enums\BookStatus;
use App\Models\Book;
use Illuminate\Support\Carbon;
use Livewire\Attributes\Layout;
use Livewire\Component;

#[Layout('layouts.app')]
class MemberIndex extends Component
{

    public $books = [];

    public function mount()
    {
        $this->books = Book::where('status',BookStatus::STATUS_NORMAL)
            ->limit(10)
            ->orderByDesc('created_at')
            ->orderByDesc('weight')
            ->get();
    }
    public function render()
    {
        return view('livewire.member-index');
    }
}
